<?php

include __DIR__ . '/../function.php';

$domain = trim($_GET['domain'] ?? '');

function show_json($m) {
    $fn = trim($_GET['callback'] ?? '');
    $r  = json_encode($m);

    if ($fn) {
        $r = $fn . '(' . $r . ')';
    }

    exit($r);
}

if (empty($domain)) {
    show_json(['s' => false, 'm' => '请输入待检测域名']);
}

sleep(10);
$r = check_domain_intercept($domain);

show_json(['s' => true, 'm' => $r]);
